<template>
  <div class="common-layout">
    <el-container>
      <el-header>
        <HomeHeader />
        <HomeNotification />
      </el-header>
      <el-container class="main-container">
        <el-aside width="200px">
          <HomeAside @menu-select="handleMenuSelect" />
        </el-aside>
        <el-container>
          <el-card class="breadcrumb">
            <HomeBreadCrumb />
          </el-card>
          <el-main>
            <HomeMain :path="index" />
          </el-main>
          <el-footer>
            <HomeFooter />
          </el-footer>
        </el-container>
      </el-container>
    </el-container>
  </div>
</template>

<script setup lang="ts">

import HomeHeader from "@/components/HomeHeader.vue"
import HomeAside from "@/components/HomeAside.vue"
import HomeMain from "@/components/HomeMain.vue"
import HomeFooter from "@/components/HomeFooter.vue"
import HomeBreadCrumb from "@/components/HomeBreadCrumb.vue"
import HomeNotification from "@/components/HomeNotification.vue"

const index = ref<string>('')

function handleMenuSelect(value: string) {
  index.value = value
}

</script>

<style lang="scss" scoped>
.common-layout {
  padding: 0px;

  header,
  aside,
  ul {
    margin: 0px;
    padding: 0px;
  }

  main {
    margin: 10px;
    padding: 0px;
  }

  footer {
    margin: 0 10px;
    padding: 0px;
  }


  .main-container {
    height: calc(100vh - 60px);

    .el-aside {
      overflow: hidden;
    }

    .breadcrumb {
      margin: 10px 10px 0 10px;
    }
  }
}
</style>